<?php 
require_once('scripts/restrict_access.php');
if ($identity->accessLevel>10){
	header('Location: AccessDenied.php');
	exit;
}
require_once('scripts/processEditContainer.php');
?>
<?php require_once('scripts/calculate_path.php'); ?>
<?php
$sql='SELECT * FROM `containers` WHERE `id` = ?';
$result = $dbRead->fetchRow($sql,$_GET['id']);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--

Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License

Title      : Complimentary
Version    : 1.0
Released   : 20080409
Description: A two-column, fixed-width and lightweight template ideal for 1024x768 resolutions. Suitable for blogs and small websites.

-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Add Container</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="CSS/ComplementaryDefault.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<!-- start header -->
<div id="header">
<div id="logo">
    <h1><a href="#">Find-it</a>
</h1></div>
<div id="menu">
  <ul>
    <li class="active"><a href="DBList.php"> Catalogs</a></li>
    <li><a href="UserList.php">Users</a></li>
    <li><a href="ManageLabels.php">Labels</a></li>
    <li><a href="Index.php?logout">Logout </a></li>
    </ul>
</div>
</div>
<!-- end header -->
<!-- start page -->
<div id="page">
  <!-- start content -->
  <div id="content">
    <div class="post">
      <p><br />
      </p>
      <div class="searchfield">
        <form method="get" action="SearchResults.php?">
    <fieldset>
      <input name="searchtext" type="text" id="s" value="" />
      <input name="dbId" type="hidden" value="<?php echo $_GET['dbId'];?>" />
      <input type="submit" id="x" value="Search" />
      </fieldset>
  </form>
</div><br/>
<h1 class="title"><?php echo $_GET['name']?></h1>
      
<div class="entry">
        <p>
        <?php echo $path ?>
        </p>
        <form id="form1" method="post" action="">
       
          <div class="rightTopFields">
              
                <span class="warning">
                <?php	if ($_POST && isset($errors['containerName'])){echo $errors['containerName'];}?>
                </span>
            <label for="containerName">Container Name</label>
                <input name="containerName" type="text" id="containerName" value="<?php echo $_GET['name']?>" size="43" maxlength="150" />
                <br />
                <label for="colorCode">Color Code&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
                <select name="colorCode" size="1" id="colorCode">
                 <?php require_once('scripts/color_code_options.php'); ?>
                </select>
                <span class="warning">
                <?php	if ($_POST && isset($errors['capacity'])){ echo $errors['capacity'];}?>
                </span>
            <label for="capacity">Capacity</label>
                <input name="capacity" type="text" id="capacity" value="<?php echo $result['capasity']?>" />
              
</div>
          <div class="bottomFields">
            
            <p>
              Notes<br />
              <textarea name="description" cols="95" rows="4"><?php echo (isset($_POST['description']) ? $_POST['description'] : $result['description'])?></textarea>
            <br/><input type="submit" name="submit" id="submit" value="Save" />
            <input type="submit" name="cancel" id="cancel" value="Cancel" />
            <input name="dbId" type="hidden" id="hiddenField" value="<?php echo $_GET['dbId']; ?>"/>
            <input name="id" type="hidden" id="hiddenField2" value="<?php echo $_GET['id']; ?>"/>
            <input name="parentId" type="hidden" id="hiddenField2" value="<?php echo $result['parentId']; ?>"/>
            <!--Calculate url parameters for delete link -->
            <a href="scripts/process_delete_container.php?id=<?php echo $result['id']; ?>&amp;name=<?php echo $result['name']; ?>&amp;dbId=<?php echo $result['dbId']; ?>&amp;parentId=<?php echo $result['parentId']; ?>&amp;parentName=<?php echo $_GET['parentName']; ?>">Delete Container</a></p>
          </div>
          
         
        </form>
        <!-- The bottomSpace div is for reserving space at the bottom for the footer -->
        <div class="bottomSpace">
          <p><br /><br />
          </p>
        </div>
      </div>
</div>
  </div>
  <!-- end content -->
  <!-- start sidebar --><!-- end sidebar -->
  <div style="clear: both;">&nbsp;</div>
</div>
<!-- end page -->
<!-- start footer -->
<div id="footer">
  <p id="legal">(c) 2012 Find-It. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.<br />
	</p>
</div>
<!-- end footer -->
</body>
</html>
